package com.zxy.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: Zxy
 * @Date: 2021-06-11
 **/
@RestController
// 用来在不需要重启微服务的情况下，将当前scope域中的信息刷新为最新的配置信息
@RefreshScope
public class DemoController {
    
    @Value("${name}")
    private String name;

    @GetMapping("/demo")
    public String demo() {
        return "demo ok" + name;
    }
}
